#!/usr/bin/python
#conding=utf8  
import os 

for path,dir_list,file_list in os.walk(r"."):  
    for full_file_name in file_list:  
        (filename,extension) = os.path.splitext(full_file_name)
        if extension == ".proto":
            cmd = "protoc -o../proto/%s.pb %s.proto" %(filename, filename)
            print(cmd)
            os.system(cmd)